from django.utils import simplejson
from google.appengine.ext import webapp

from datetime import date
from datetime import datetime

from lt.vincnetas.melina.dao.documentsDao import DocumentsDao 


class Documents(webapp.RequestHandler):
    def get(self):
        documentsDao = DocumentsDao()
        documents = documentsDao.getDocuments(datetime.strptime(self.request.get("date"), "%Y-%m-%d").date(), "any")

        #json = []
        for document in documents :
           self.response.out.write(document.date.isoformat() + "<br/>")
        
        #self.response.out.write(simplejson.dumps(json))